#pragma once

#include "Column.h"

namespace ExcelLibrary
{
	class CSheet : public ISheet
	{
	public:
		CSheet(_Recordset* pRecordset);
		~CSheet();

		HRESULT STDMETHODCALLTYPE QueryInterface( 
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
        
        ULONG STDMETHODCALLTYPE AddRef(void);
        ULONG STDMETHODCALLTYPE Release(void);

		bool Initialize();

		bool EndOfRow();
		bool MoveNextRow();
		bool MovePrevRow();
		bool MoveRow(unsigned long ulRowPos);
		unsigned long GetRowCount();
		unsigned long GetColumnCount();
		IColumn* GetColumn(unsigned long ulColumnPos);

	private:
		DWORD m_dwRefCount;
		_Recordset* m_pRecordset;
		Fields* m_pFields;
		unsigned long m_ulRowPos;
		unsigned long m_ulRowCount;
		unsigned long m_ulColumnCount;
	};
}